﻿<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv=Content-Type content="text/html; charset=UTF-8">
		<title>WXPAY</title>
	</head>
	<body>
	商 家 号：<input type="text" id="merchant_code" value="1111110166">*<br/>

	业务类型：<input type="text" id="service_type" value="wxpay">*<br/>

	服务器异步通知地址：<input type="text" id="notify_url" value="http://www.dinpay.com/Notify_Url.jsp"/>*<br/>
	
	接口版本：<input type="text" id="interface_version" value="V3.0"/>*<br/>

	签名方式：<input type="text" id="sign_type" value="RSA-S"/>*<br/>

	商家订单编号：<input type="text" id="order_no" value="1000201666"/>*<br/>

	商家订单时间：<input type="text" id="order_time" value="2015-11-11 12:12:12"/>*<br/>

	订单金额：<input type="text" id="order_amount" value="12.01"/>*<br/>

	商品名称：<input type="text" id="product_name" value="shoes"/>*<br/>

	商品编号：<input type="text" id="product_code" value=""><br/>

	商品数量：<input type="text" id="product_num" value=""><br/>

	商品描述：<input type="text" id="product_desc" value=""><br/>

	公用回传参数：<input type="text" id="extra_return_param" value=""><br/>

	公用业务扩展参数：<input type="text" id="extend_param" value=""><br/>
	
	<button id="submit">支付</button>
	
	<h4>智付返回结果：</h4>
	
	<p id="queryresult"></p>

	<script>
		document.getElementById("submit").onclick = function() { 
		var request = new XMLHttpRequest();
		request.open("POST", "wxDinpay.php");
		var data = "merchant_code=" + document.getElementById("merchant_code").value 
					  + "&sign_type=" + document.getElementById("sign_type").value 
	                  + "&service_type=" + document.getElementById("service_type").value
					  + "&order_no=" + document.getElementById("order_no").value
					  +"&order_time=" + document.getElementById("order_time").value
					  +"&order_amount=" + document.getElementById("order_amount").value
					  +"&product_name=" + document.getElementById("product_name").value
					  +"&product_code=" + document.getElementById("product_code").value
					  +"&product_num=" + document.getElementById("product_num").value
					  +"&product_desc=" + document.getElementById("product_desc").value
					  + "&extra_return_param=" + document.getElementById("extra_return_param").value
					  +"&extend_param=" + document.getElementById("extend_param").value
					  + "&notify_url=" + document.getElementById("notify_url").value
					  +"&interface_version=" + document.getElementById("interface_version").value; 
					  
		request.setRequestHeader("Content-type","application/x-www-form-urlencoded");
		request.send(data);
		request.onreadystatechange = function() {
		if (request.readyState===4) {
			if (request.status===200) { 
				document.getElementById("queryresult").innerHTML = request.responseText;
			} else {
				alert("发生错误：" + request.status);
			}
		} 
	}
}
	</script>
	</body>
</html>